package com.tensquare.base.client;

import com.ruoyi.common.core.web.domain.AjaxResult;
import com.tensquare.base.client.factory.GatheringClientFactory;
import com.tensquare.base.domain.Gathering;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * Created by WF on 2021/8/31 14:42
 * OpenFeign: 底层使用动态代理实现
 */
@FeignClient(value = "tensquare-gathering", fallbackFactory = GatheringClientFactory.class/*fallback = GatheringClientImpl.class*/)
public interface GatheringClient {

    @GetMapping("/gathering/findAll")
    public AjaxResult findAll();

    @GetMapping("/gathering/findId/{id}")
    public AjaxResult findById2(@PathVariable("id") String id);

    // http://localhost:9104//gathering/findId/{id}
    @PostMapping("/gathering/add")
    public AjaxResult add2(@RequestBody Gathering gathering);
}
